package com.evil.account.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.evil.account.pojo.entity.UserDepartment;
import com.evil.common.account.dto.department.DepartmentBaseRespDTO;
import com.evil.common.account.dto.user.UserEnterpriseDTO;
import com.evil.common.account.dto.user.department.DepartmentManagerSettingReqDTO;
import com.evil.common.account.dto.user.department.UserDepartmentBaseRespDTO;
import com.evil.common.account.dto.user.department.UserDepartmentReqDTO;
import com.evil.common.account.dto.user.department.UserDeptManageReqDTO;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * 用户部门表
 *
 * @author liyang
 * @date 2022-08-08 00:00
 */
public interface UserDepartmentService extends IService<UserDepartment> {

    /**
     * 获取企业用户部门列表
     *
     * @param userEnterpriseDTO userEnterpriseDTO
     * @return UserDepartment 列表
     */
    List<UserDepartment> findByEnterpriseUser(UserEnterpriseDTO userEnterpriseDTO);

    /**
     * 用户部门基础信息
     *
     * @param userEnterpriseDTO userEnterpriseDTO
     * @return DepartmentBaseRespDTO 列表
     */
    List<DepartmentBaseRespDTO> userDepartmentBases(@Validated @RequestBody UserEnterpriseDTO userEnterpriseDTO);

    /**
     * 用户部门基础信息
     *
     * @param userEnterpriseDTO userEnterpriseDTO
     * @return UserDepartmentBaseRespDTO 列表
     */
    List<UserDepartmentBaseRespDTO> findUserDepartmentBaseByUserEnterprise(@Validated @RequestBody UserEnterpriseDTO userEnterpriseDTO);

    /**
     * 配置部门主管（单个用户）
     *
     * @param userDeptManageReqDTO userDeptManageReqDTO
     */
    void userDepartmentManager(@Validated @RequestBody UserDeptManageReqDTO userDeptManageReqDTO);

    /**
     * 配置部门主管（整个部门，方法没有校验权限）
     *
     * @param departmentManagerSettingReqDTO departmentManagerSettingReqDTO
     */
    void departmentManagerSetting(DepartmentManagerSettingReqDTO departmentManagerSettingReqDTO);

    /**
     * 修改用户部门（覆盖性）
     *
     * @param enterpriseId enterpriseId
     * @param userId       userId
     * @param departments  departments
     */
    void modify(Long enterpriseId, Long userId, List<UserDepartmentReqDTO> departments);
}
